package com.yozinga.processor;

import org.json.JSONObject;

import android.util.Log;

import com.yozinga.entity.Offers;

public class OffersProcessor {

	public Offers getList(String response){
		Offers bean = new Offers();
		if(response!=null){
			try{
				JSONObject jsonObject = new JSONObject(response);
				bean.setOfferId(jsonObject.getString("Id"));
				bean.setDealName(jsonObject.getString("Headline"));
				bean.setDealDesc(jsonObject.getString("Description"));
				bean.setImageLogoUrl(jsonObject.getString("FullImage"));

				bean.setOfferTagLine(jsonObject.getString("OfferTagLine"));
				bean.setOfferLimitations(jsonObject.getString("OfferLimitations"));
				bean.setOfferStart(jsonObject.getString("OfferStart"));
				bean.setOfferEnd(jsonObject.getString("OfferEnd"));
				
			}catch (Exception e) {
				Log.i("NCS","Exception   :"+e.getMessage());
			}

		}
		return bean;
	}

	public String getImages(String response){
		String image = null;
		if(response!=null){
			
			try{
				JSONObject jsonObject = new JSONObject(response);
				image = jsonObject.getString("ThumbnailImage");
			}catch (Exception e) {
				Log.i("NCS","Exception   :"+e.getMessage());
			}
		}
		return image;
	}
}